package top.gohigh.springboot.service.impl;

import org.springframework.stereotype.Service;
import top.gohigh.springboot.dao.PermissionDao;
import top.gohigh.springboot.model.Permission;
import top.gohigh.springboot.service.PermService;

import javax.annotation.Resource;


@Service
public class PermServiceImpl implements PermService {

    @Resource
    PermissionDao permissionDao;

    @Override
    public Permission findById(Long id) {
        return permissionDao.findById(id).get();
    }

    @Override
    public Permission add(String name, String perm) {
        Permission p=new Permission(name,perm);
        permissionDao.save(p);
        return p;
    }
}
